import { Module,Global} from '@nestjs/common';
//import { CodeErrorModule } from "./middleware/error/error.code";
//import { HttpExceptionFilter } from "./middleware/error/error.module"
/**
 *
 * 工厂提供者
 * const connectionFactory = {
  provide: 'CONNECTION',
  useFactory: (optionsProvider: OptionsProvider) => {
    const options = optionsProvider.get();
    return new DatabaseConnection(options);
  },
  inject: [OptionsProvider],
  {
      provide: 'ASYNC_CONNECTION',
      useFactory: async () => {
        const connection = await createConnection(options);
        return connection;
      },
  }
};

 */
@Module({
    imports: [],
    controllers: [],
    providers: [],
    /**
     *  provide: 'CONNECTION', 令牌描述，对应@Inject()，注入constructor(@Inject('CONNECTION') connection: Connection) {}
     *  useClass： 可以根据不同提供不同的提供者
     *  useValue 注入常量
     */
    exports:[]
})
export class CommonModule {}
